import { App, ref } from 'vue'
import SigninModal from './index.vue'

const visible = ref(false)

export function setupSigninModal(app: App) {
    const show = () => {
        visible.value = true
    }

    const hide = () => {
        visible.value = false
    }
    
    // 添加到全局属性
    app.config.globalProperties.$signin = {
        visible,
        show,
        hide
    }

    // 注册全局组件
    app.component('SigninModal', SigninModal)
} 